import config from "@/config"
import http from "@/utils/request"

export default {
	getPageList: {
		url: `${config.API_URL}/api/Role/GetRolePageList`,
		name: "根据关键字获取对应的角色分页列表",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	getAllList: {
		url: `${config.API_URL}/api/Role/GetAllList`,
		name: "获取所有角色列表信息",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	forbidOrEnable: {
		url: `${config.API_URL}/api/Role/ForbidOrEnable`,
		name: "禁用/启用角色",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	create: {
		url: `${config.API_URL}/api/Role/Create`,
		name: "创建角色信息",
		post: async function(data={}){
			return await http.post(this.url, data);
		}
	},
	update: {
		url: `${config.API_URL}/api/Role/Update`,
		name: "编辑角色信息",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	updateRoleMenu: {
		url: `${config.API_URL}/api/Role/UpdateRoleMenu`,
		name: "修改角色对应的菜单权限信息",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	updateRoleUser: {
		url: `${config.API_URL}/api/Role/UpdateRoleUser`,
		name: "修改角色对应的用户信息",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	deleteById: {
		url: `${config.API_URL}/api/Role/DeleteById`,
		name: "根据Id删除角色信息",
		delete: async function(data={}){
			return await http.delete(this.url, data);
		}
	},
	deleteByIds: {
		url: `${config.API_URL}/api/Role/DeleteByIds`,
		name: "批量删除角色信息",
		delete: async function(data={}){
			return await http.delete(this.url, data);
		}
	},
	deleteUserRole: {
		url: `${config.API_URL}/api/Role/DeleteUserRole`,
		name: "删除指定的用户-角色关系",
		delete: async function(data={}){
			return await http.delete(this.url, data);
		}
	},
}
